//
//  HEGoodDetailsHeaderView.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/10/20.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEGoodDetailsHeaderView.h"
#import <SDCycleScrollView.h>

@interface HEGoodDetailsHeaderView ()<SDCycleScrollViewDelegate>

@property(nonatomic, strong) SDCycleScrollView *cycleScrollView;

@end
@implementation HEGoodDetailsHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initUI];
    }
    return self;
}

- (void)initUI {
    SDCycleScrollView *cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero delegate:self placeholderImage:[UIImage imageNamed:@""]];
    cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleClassic;
    cycleScrollView.autoScrollTimeInterval = 5;// 自定义轮播时间间隔

    cycleScrollView.pageControlDotSize = CGSizeMake(20, 6);  // pageControl小圆点的大小
    cycleScrollView.pageDotColor = [UIColor.blackColor colorWithAlphaComponent:0.4];

    cycleScrollView.imageURLStringsGroup = @[];
    cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;

    [self addSubview:cycleScrollView];
    _cycleScrollView = cycleScrollView;

    cycleScrollView.sd_layout
    .leftSpaceToView(self, 0)
    .rightSpaceToView(self, 0)
    .topSpaceToView(self, 0)
    .heightIs(300);
}

- (void)setModel:(HEGoodsModel *)model {
    _model = model;
    _cycleScrollView.imageURLStringsGroup = model.kalbumPics;
}

@end
